<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Utilities</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../boost_units.html" title="Chapter 44. Boost.Units 1.1.0">
<link rel="prev" href="Examples.html" title="Examples">
<link rel="next" href="Reference.html" title="Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="Examples.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_units.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Reference.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_units.Utilities"></a><a class="link" href="Utilities.html" title="Utilities">Utilities</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="Utilities.html#boost_units.Utilities.Metaprogramming_Classes">Metaprogramming
      Classes</a></span></dt>
<dt><span class="section"><a href="Utilities.html#boost_units.Utilities.Metaprogramming_Predicates">Metaprogramming
      Predicates</a></span></dt>
</dl></div>
<p>
      Relatively complete SI and CGS unit systems are provided in <code class="computeroutput"><a class="link" href="Reference.html#header.boost.units.systems.si_hpp" title="Header &lt;boost/units/systems/si.hpp&gt;">boost/units/systems/si.hpp</a></code>
      and <code class="computeroutput"><a class="link" href="Reference.html#header.boost.units.systems.cgs_hpp" title="Header &lt;boost/units/systems/cgs.hpp&gt;">boost/units/systems/cgs.hpp</a></code>,
      respectively.
    </p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_units.Utilities.Metaprogramming_Classes"></a><a class="link" href="Utilities.html#boost_units.Utilities.Metaprogramming_Classes" title="Metaprogramming Classes">Metaprogramming
      Classes</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">ordinal</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span><span class="keyword">typename</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">get_tag</span><span class="special">&lt;</span> <span class="identifier">dim</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">V</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span><span class="keyword">typename</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">get_value</span><span class="special">&lt;</span> <span class="identifier">dim</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">V</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">DT</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">get_system_tag_of_dim</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span><span class="identifier">DT</span><span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Seq</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">make_dimension_list</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">DT</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">fundamental_dimension</span><span class="special">&lt;</span><span class="identifier">DT</span><span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">DT1</span><span class="special">,</span><span class="keyword">int</span> <span class="identifier">E1</span><span class="special">,...&gt;</span> <span class="keyword">struct</span> <span class="identifier">composite_dimension</span><span class="special">&lt;</span><span class="identifier">DT1</span><span class="special">,</span><span class="identifier">E1</span><span class="special">,...&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Dim</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">get_dimension</span><span class="special">&lt;</span> <span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">Dim</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Unit</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">get_dimension</span><span class="special">&lt;</span> <span class="identifier">quantity</span><span class="special">&lt;</span><span class="identifier">Unit</span><span class="special">,</span><span class="identifier">Y</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Dim</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">get_system</span><span class="special">&lt;</span> <span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">Dim</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Unit</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">get_system</span> <span class="identifier">quantity</span><span class="special">&lt;</span><span class="identifier">Unit</span><span class="special">,</span><span class="identifier">Y</span><span class="special">&gt;</span> <span class="special">&gt;;</span>

<span class="keyword">struct</span> <span class="identifier">dimensionless_type</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">dimensionless_unit</span><span class="special">&lt;</span><span class="identifier">System</span><span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">dimensionless_quantity</span><span class="special">&lt;</span><span class="identifier">System</span><span class="special">,</span><span class="identifier">Y</span><span class="special">&gt;;</span>

<span class="keyword">struct</span> <span class="identifier">implicitly_convertible</span><span class="special">;</span>
<span class="keyword">struct</span> <span class="identifier">trivial_conversion</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">S1</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">S2</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">base_unit_converter</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">S1</span><span class="special">,</span><span class="identifier">S2</span><span class="special">&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Q1</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Q2</span><span class="special">&gt;</span> <span class="keyword">class</span> <span class="identifier">conversion_helper</span><span class="special">&lt;</span><span class="identifier">Q1</span><span class="special">,</span><span class="identifier">Q2</span><span class="special">&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_units.Utilities.Metaprogramming_Predicates"></a><a class="link" href="Utilities.html#boost_units.Utilities.Metaprogramming_Predicates" title="Metaprogramming Predicates">Metaprogramming
      Predicates</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span><span class="keyword">typename</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_dim</span><span class="special">&lt;</span> <span class="identifier">dim</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">V</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span><span class="keyword">typename</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_empty_dim</span><span class="special">&lt;</span> <span class="identifier">dim</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">V</span><span class="special">&gt;</span> <span class="special">&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Seq</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_dimension_list</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_system</span><span class="special">&lt;</span> <span class="identifier">homogeneous_system</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_system</span><span class="special">&lt;</span> <span class="identifier">heterogeneous_system</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_homogeneous_system</span><span class="special">&lt;</span> <span class="identifier">homogeneous_system</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_heterogeneous_system</span><span class="special">&lt;</span> <span class="identifier">heterogeneous_system</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">&gt;</span> <span class="special">&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Dim</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_unit</span><span class="special">&lt;</span> <span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">Dim</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Dim</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_unit_of_system</span><span class="special">&lt;</span> <span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">Dim</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;,</span><span class="identifier">System</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Dim</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_unit_of_dimension</span><span class="special">&lt;</span> <span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">Dim</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;,</span><span class="identifier">Dim</span> <span class="special">&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Unit</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_quantity</span><span class="special">&lt;</span> <span class="identifier">quantity</span><span class="special">&lt;</span><span class="identifier">Unit</span><span class="special">,</span><span class="identifier">Y</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Dim</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_quantity_of_system</span><span class="special">&lt;</span> <span class="identifier">quantity</span><span class="special">&lt;</span><span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">Dim</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;,</span><span class="identifier">Y</span><span class="special">&gt;,</span><span class="identifier">System</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Dim</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_quantity_of_dimension</span><span class="special">&lt;</span> <span class="identifier">quantity</span><span class="special">&lt;</span><span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">Dim</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;,</span><span class="identifier">Y</span><span class="special">&gt;,</span><span class="identifier">Dim</span> <span class="special">&gt;;</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_dimensionless</span><span class="special">&lt;</span> <span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">dimensionless_type</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_dimensionless_unit</span><span class="special">&lt;</span> <span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">dimensionless_type</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_dimensionless</span><span class="special">&lt;</span> <span class="identifier">quantity</span><span class="special">&lt;</span><span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">dimensionless_type</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;,</span><span class="identifier">Y</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">System</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_dimensionless_quantity</span><span class="special">&lt;</span> <span class="identifier">quantity</span><span class="special">&lt;</span><span class="identifier">unit</span><span class="special">&lt;</span><span class="identifier">dimensionless_type</span><span class="special">,</span><span class="identifier">System</span><span class="special">&gt;,</span><span class="identifier">Y</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
</pre>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2008 Matthias Christian Schabel<br>Copyright © 2007-2010 Steven
      Watanabe<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="Examples.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_units.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Reference.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
